from wtforms import Form, StringField
from wtforms.validators import EqualTo, Length, InputRequired


class PassWordCheck(Form):
    old_password = StringField(
        validators=[InputRequired(message='密码不能为空')])
    new_password = StringField(
        validators=[InputRequired(message='密码不能为空'), Length(min=6, max=18, message='密码长度必须在6-18之间')])
    new_password2 = StringField(
        validators=[InputRequired(message='密码不能为空'), Length(min=6, max=18, message='密码长度必须在6-18之间'),
                    EqualTo('new_password ')])
